package com.my.study.designPatterns.proxyPattern.dynamicProxy;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 ** 动态代理类
 **/
 public class UserServiceDynamicProxy implements InvocationHandler {

     //需要代理的对象
    private Object waitProxyObj;

    public UserServiceDynamicProxy(Object waitProxyObj) {
        this.waitProxyObj = waitProxyObj;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        return method.invoke(waitProxyObj, args);
    }
}
